<html><head>
    <meta http-equiv="content-type" content="text/html; charset=UTF-8"><title>Lof</title></head>
<body bgcolor="#EFF1F0" link="#3A3966" vlink="#000000" alink="#000000">
<font face="Verdana, sans-serif" size="2"><p align="center"><b><font size="4">Lof()</font></b></p>
<p><b>语法</b></p><blockquote>

Length.q = <font color="#3A3966"><b>Lof</b></font>(#File)</blockquote>

</blockquote>
<b>概要</b><br><blockquote>



Returns the length of the specified file. 

 

</blockquote><p><b>参数</b></p><blockquote>
<style type="text/css">
table.parameters { border-spacing: 0px; border-style: none; border-collapse: collapse; }
table.parameters td { border-width: 1px; padding: 6px; border-style: solid; border-color: gray; vertical-align: top; font-family:Arial; font-size:10pt; }
</style>
<table width="90%" class="parameters">
<tr><td width="10%"><i>#File</i></td>
<td width="90%"> 
 
The file to use. 

 

</td></tr>
</table>
</blockquote><p><b>返回值</b></p><blockquote>



Returns the length of the file in bytes. 

 

</blockquote><p><b>示例</b></p><blockquote>

<pre><font face="Courier New, Courier, mono"size="2">
  file$ =<font color="#3A3966"> OpenFileRequester</font>("Select a file","","Text (.txt)|*.txt|All files (*.*)|*.*",0)
  <b><font color="#3A3966">If</font></b> file$
    <b><font color="#3A3966">If</font></b> <font color="#3A3966">ReadFile</font>(0, file$)
      length =<font color="#3A3966"> Lof</font>(0)                            <font color="#3A3966">; get the length of opened file</font>
      *MemoryID =<font color="#3A3966"> AllocateMemory</font>(length)         <font color="#3A3966">; allocate the needed memory</font>
      <b><font color="#3A3966">If</font></b> *MemoryID
        bytes =<font color="#3A3966"> ReadData</font>(0, *MemoryID, length)   <font color="#3A3966">; read all data into the memory block</font>
        <b><font color="#3A3966">Debug</font></b> "Number of bytes read: " +<font color="#3A3966"> Str</font>(bytes)
      <b><font color="#3A3966">EndIf</font></b>
<font color="#3A3966">      CloseFile</font>(0)
    <b><font color="#3A3966">EndIf</font></b>
  <b><font color="#3A3966">EndIf</font></b>

</font></pre>

</blockquote><p><b>参阅</b></p><blockquote>

<a href="loc.html">Loc()</a>, <a href="fileseek.html">FileSeek()</a>, <a href="../filesystem/filesize.html">FileSize()</a> 

</Blockquote><p><b>已支持操作系统 </b><Blockquote>所有</Blockquote></p><center>&lt;- <a href=loc.html>Loc()</a> - <a href="index.html">File Index</a> - <a href="openfile.html">OpenFile()</a> -&gt;<br><br>

</body></html>